﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Functions/Employees/employees.master" AutoEventWireup="true" CodeBehind="Main.aspx.cs" Inherits="HRDexCapstoneProject.Functions.Employees.WebForm1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainPage" runat="server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="EmployeeID" DataSourceID="formEmp">
        <Columns>
        
  
            <asp:BoundField DataField="EmployeeID" HeaderText="EmployeeID" 
                SortExpression="EmployeeID" ReadOnly="True" />
            <asp:BoundField DataField="LastName" HeaderText="LastName" 
                SortExpression="LastName" />
            <asp:BoundField DataField="FirstName" HeaderText="FirstName" 
                SortExpression="FirstName" />
            <asp:BoundField DataField="MiddleName" HeaderText="MiddleName" 
                SortExpression="MiddleName" />
            <asp:BoundField DataField="catPositionsName" HeaderText="catPositionsName" 
                SortExpression="catPositionsName" />
            <asp:BoundField DataField="DepartmentName" HeaderText="DepartmentName" 
                SortExpression="DepartmentName" />
            <asp:BoundField DataField="CollegeName" HeaderText="CollegeName" 
                SortExpression="CollegeName"/>
            <asp:BoundField DataField="catUserLevelName" HeaderText="catUserLevelName" 
                SortExpression="catUserLevelName"/>
   <asp:TemplateField HeaderText="View Details"> 
<ItemTemplate> 
    <asp:HyperLink ID="lnkSelect" runat='server' NavigateUrl='<%# String.Format("~/Functions/Employees/Add.aspx?EmployeeID={0}", Eval("EmployeeID")) %>'>Select</asp:HyperLink> 
</ItemTemplate> 
</asp:TemplateField>
            
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="formEmp" runat="server" 
        ConnectionString="<%$ ConnectionStrings:HRmainConnectionString %>" 
        
        SelectCommand="SELECT formEmployees.EmployeeID, formEmployees.LastName, formEmployees.FirstName, formEmployees.MiddleName, catPositions.catPositionsName, catDepartment.DepartmentName, catCollege.CollegeName, catUserLevel.catUserLevelName FROM formEmployees INNER JOIN catUserLevel ON formEmployees.UserLevelID = catUserLevel.UserLevelID INNER JOIN catPositions ON formEmployees.catPositionsID = catPositions.catPositionsID INNER JOIN catCollege ON formEmployees.CollegeID = catCollege.CollegeID INNER JOIN catDepartment ON formEmployees.DeptID = catDepartment.DeptID">
    </asp:SqlDataSource>
    </asp:Content>
